#include "../chargen/chargen.h"
#include "../daytime/daytime.h"
#include "../discard/discard.h"
#include "../echo/echo.h"
#include "../time/time.h"

#include <muduo/base/Logging.h>
#include <muduo/net/EventLoop.h>

using namespace muduo;
using namespace muduo::net;

int 
main() {
    LOG_INFO << "pid = " << getpid();
    EventLoop loop;  // one loop shared by multiple servers

    ChargenServer chargenServer(&loop, InetAddress(2019));
    chargenServer.Start();

    DaytimeServer daytimeServer(&loop, InetAddress(2013));
    daytimeServer.Start();

    DiscardServer discardServer(&loop, InetAddress(2009));
    discardServer.Start();

    EchoServer echoServer(&loop, InetAddress(2007));
    echoServer.Start();

    TimeServer timeServer(&loop, InetAddress(2037));
    timeServer.Start();

    loop.loop();
}

